import 'package:zz_video_maker/src/types/resource.dart';

import '../impl/text_widget.dart';
import 'types.dart';

enum ETextType { Title, Caption }

class TextWidgetData {
  ETextType type;
  String json;
  double letterSpacing;

  List<String> fontFamily;
  List<String> fontBase64;
  List<String> texts = [];

  TextWidgetData(this.type, this.json, this.fontFamily, this.fontBase64,
      this.letterSpacing);
}

class TextExportData {
  String id;
  double width;
  double height;
  double frameRate;
  int totalFrameCount;
  String allSequencesPath;
  Map<String, ZZText> textDataMap;

  TextExportData(this.id, this.width, this.height, this.frameRate,
      this.totalFrameCount, this.allSequencesPath, this.textDataMap);
}

class EditedTextData extends EditedComponentData with EditedComponentDataMixin {
  String id;

  Map<String, String> texts = {};

  TextExportData? textExportData;
  String? previewImagePath;
  String? get text1 => texts['#TEXT1'];
  String? get text2 => texts['#TEXT2'];

  EditedTextData(this.id, super.x, super.y, super.width, super.height,
      {this.previewImagePath});
}

class FlutterTextModel {
  String text;
  double x = 0;
  double y = 0;
  double fontSize = 20;
  String fontColor = 'white';

  String? fontFile;
  double alpha = 1;
  String? shadowColor;

  int? box;
  String? boxColor;
  double? boxBorderW;
  String? boxBorderColor;

  // 其他的文本样式属性

  FlutterTextModel(
    this.text, {
    this.x = 0,
    this.y = 0,
    this.fontSize = 20,
    this.fontColor = 'white',
    this.fontFile,
    this.box,
    this.boxColor,
    this.boxBorderW,
    this.boxBorderColor,
    this.alpha = 1,
    this.shadowColor,
    // 其他的文本样式属性
  });
}
